package cn.shujuhai.cms.service.thymeleaf;

import lombok.RequiredArgsConstructor;
import org.springframework.cache.CacheManager;
import org.springframework.stereotype.Component;

import java.util.Objects;

@Component
@RequiredArgsConstructor
public class SysTool {
    private final CacheManager cacheManager;

    public String fetchSettingValue(String key) {
        return Objects.requireNonNull(cacheManager.getCache("sys_setting")).get(key, String.class);
    }
}
